package router

import (
	"github.com/kataras/iris"
	"github.com/kataras/iris/mvc"

	"im/admins/controller"
	"im/admins/middlewares"
)

func AdminRouter(router *iris.Application) {
	var admins = router.Party("/admins")
	// app授权

	mvc.Configure(admins.Party("/systems"), func(app *mvc.Application) {
		app.Router.Use(middlewares.AdminUserVerify)
		app.Handle(new(controller.Systems))
	})
	mvc.Configure(admins.Party("/groups"), func(app *mvc.Application) {
		app.Router.Use(middlewares.AdminUserVerify)
		app.Handle(new(controller.Groups))
	})
	mvc.Configure(admins.Party("/utils"), func(app *mvc.Application) {
		app.Router.Use(middlewares.AdminUserVerify)
		app.Handle(new(controller.Utils))
	})
	mvc.Configure(admins.Party("/posts"), func(app *mvc.Application) {
		app.Router.Use(middlewares.AdminUserVerify)
		app.Handle(new(controller.Posts))
	})
}